package model;



import java.awt.BorderLayout;
import java.awt.Point;
import java.awt.geom.Point2D;
import java.awt.image.BufferedImage;

import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;

import view.panels.MapPanel;


public class Prueba extends JFrame {

	public Prueba(BufferedImage imagen) {
		
		ImageIcon icon = new ImageIcon(imagen);
		JLabel label = new JLabel(icon);
		add(label);
		setVisible(true);
		setSize(1000,700);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
		
	}
	
	public Prueba() {
		
		this.setLayout(new BorderLayout());
		MapPanel mapPanel = new MapPanel(); // just a JPanel extension, add to any swing/awt container
		mapPanel.setZoom(16); // set some zoom level (1-18 are valid)
		mapPanel.getOverlayPanel().setVisible(false);
		double lon = -3.698502;
		double lat = 40.437541;
		Point position = mapPanel.computePosition(new Point2D.Double(lon, lat));
		mapPanel.setCenterPosition(position); // sets to the computed position
		mapPanel.repaint(); // if already visible trigger a repaint here
		add(BorderLayout.CENTER,mapPanel);
		setVisible(true);
		setSize(800,800);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
	
	public static void main(String[] args) {
		
		Prueba p = new Prueba();
	}
	
	
}
